// vue3框架提供的方法createApp方法，可以用来创建应用实例方法
import { createApp } from 'vue'
//引入清除默认样式
import '@/style/reset.scss'
//引入根组件App
import App from './App.vue'
//引入全局组件--顶部、底部都是全局组件
import HospitalTop from '@/components/HospitalTop/index.vue'
import HospitalBottom from '@/components/HospitalBottom/index.vue'
import Login from "@/components/Login/index.vue"
//引入vue-router核心插件并安装
import router from '@/router'
//引入elment-plus插件
import ElementPlus from 'element-plus'
//引入icon插件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
//国际化、
import zhCn from 'element-plus/es/locale/lang/zh-cn'
//引入Pinia仓库
import pinia from '@/store'

//利用creatApp方法创建应用实例，且将应用实例挂载到挂载点上
const app = createApp(App);
app.component('HospitalTop',HospitalTop)
app.component('HospitalBottom',HospitalBottom)
app.component('Login',Login)
//安装vue-router
app.use(router)
//安装elment-plus插件
app.use(ElementPlus,{
  locale: zhCn,
})
//注册icon插件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
//安装pinia仓库
app.use(pinia)
//挂载
app.mount('#app')
